package com.andy.service.impl;

import com.andy.service.HelloService;
import com.andy.util.ThreadLocalUrlUtil;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.config.annotation.Service;

@Service
public class HelloServiceImpl implements HelloService {

    public String sayHello(String name) {
        URL url = ThreadLocalUrlUtil.getUrl();
        System.out.println("threadLocal 获取到的IP "+url.getIp()+":"+ url.getPort());
        return "Hello "+name;
    }
}
